<?php
    require_once('../framework/msc-load.php');
    require_once('../framework/includes/session-handler-admin.php');
    require_once('../framework/msc-functions.php');
?>
<!DOCTYPE HTML>
<html>

<head>
    <title>Add Hotel - MSC Hotels</title>
    
    <meta content="text/html;charset=utf-8" http-equiv="Content-Type">
    <meta name="keywords" content="" />
    <meta name="description" content="">
    <meta name="author" content="MSC Team">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <!-- GOOGLE FONTS -->
    <link href='http://fonts.googleapis.com/css?family=Roboto:400,300,100,500,700' rel='stylesheet' type='text/css'>
    <link href='http://fonts.googleapis.com/css?family=Open+Sans:400italic,400,300,600' rel='stylesheet' type='text/css'>
    <!-- /GOOGLE FONTS -->
    
    <link rel="stylesheet" href="../assets/css/bootstrap.css">
    <link rel="stylesheet" href="../assets/css/font-awesome.css">
    <link rel="stylesheet" href="../assets/css/icomoon.css">
    <link rel="stylesheet" href="../assets/css/styles.css">
    <script src="../assets/js/modernizr.js"></script>
    
</head>

<body>

    <div class="global-wrap">
        <header id="main-header">
            <div class="header-top">
                <div class="container">
                    <div class="row">
                        <div class="col-md-3">
                            <a class="logo" href="../">
                                <img src="../assets/img/logo-invert.png" alt="Image Alternative text" title="Image Title" />
                            </a>
                        </div>
                        <div class="col-md-5">
                            <h5 class="text-color">NOTICE: This is an experimental project.</h5>
                        </div>
                        <div class="col-md-4">
                            <div class="top-user-area clearfix">
                                <ul class="top-user-area-list list list-horizontal list-border">
                                    <li class="top-user-area-avatar"><a>Hi, <?php echo getUserName(); ?></a></li>
                                    <li><a href="/logout.php">Log Out</a></li>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </header>
        
        <div class="gap"></div>

        <div class="container">
            <div class="row">
                <div class="col-md-3">
                    <aside class="user-profile-sidebar">
                        <ul class="list user-profile-nav">
                            <li><a href="index.php"><i class="fa fa-database"></i>Reservations</a>
                            </li>
                            <li class="active-child"><a href="hotels.php"><i class="fa fa-building"></i>Hotels</a>
                                <ul>
                                    <li class="active"><a href="add-hotel.php"><i class="fa fa-plus-square-o"></i>Add Hotel</a></li>
                                </ul>
                            </li>
                            <li><a href="users.php"><i class="fa fa-users"></i>Users</a>
                            </li>
                        </ul>
                    </aside>
                </div>
                <div class="col-md-9">
                    <form class="addHotel_form" action="../framework/msc-hotel.php" method="post" enctype="multipart/form-data">
                        <h2>Add Hotel</h2>
                        <h4>General Information</h4>
                        <div class="row">
                            <div class="col-md-6">
                                <div class="form-group">
                                    <label>Name *</label>
                                    <input name="hotel_name" type="text" value="" class="form-control required">
                                </div>
                                <div class="form-group">
                                    <label>Email</label>
                                    <input name="hotel_email" type="text" value="" class="form-control">
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="form-group">
                                    <label>Phone *</label>
                                    <input name="hotel_phone" type="text" value="" class="form-control required">
                                </div>
                                <div class="form-group">
                                    <label>Website</label>
                                    <input name="hotel_website" type="text" value="" class="form-control">
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label>Details</label>
                            <textarea name="hotel_details" class="form-control"></textarea>
                        </div>
                        <div class="form-group">
                            <label>Stars</label>
                            <div class="radio-inline radio-small"><label><input class="i-radio" type="radio" name="stars" value="1" />1 Star</label></div>
                            <div class="radio-inline radio-small"><label><input class="i-radio" type="radio" name="stars" value="2" />2 Stars</label></div>
                            <div class="radio-inline radio-small"><label><input class="i-radio" type="radio" name="stars" value="3" />3 Stars</label></div>
                            <div class="radio-inline radio-small"><label><input class="i-radio" type="radio" name="stars" value="4" />4 Stars</label></div>
                            <div class="radio-inline radio-small"><label><input class="i-radio" type="radio" name="stars" value="5" />5 Stars</label></div>
                        </div>
                        <div class="form-group">
                            <label>Facilities</label>
                                <div class="checkbox-inline checkbox-small"><label><input class="i-check" type="checkbox" name="facilities[]" value="wifi" />Wi-Fi Internet</label></div>
                                <div class="checkbox-inline checkbox-small"><label><input class="i-check" type="checkbox" name="facilities[]" value="parking" />Parking</label></div>
                                <div class="checkbox-inline checkbox-small"><label><input class="i-check" type="checkbox" name="facilities[]" value="pool" />Pool</label></div>
                                <div class="checkbox-inline checkbox-small"><label><input class="i-check" type="checkbox" name="facilities[]" value="spa" />SPA</label></div>                         
                                <div class="checkbox-inline checkbox-small"><label><input class="i-check" type="checkbox" name="facilities[]" value="restaurant" />Restaurant</label></div>
                                <div class="checkbox-inline checkbox-small"><label><input class="i-check" type="checkbox" name="facilities[]" value="wheelchair" />Wheelchair Access</label></div>
                                <div class="checkbox-inline checkbox-small"><label><input class="i-check" type="checkbox" name="facilities[]" value="business_center" />Business Center</label></div>
                                <div class="checkbox-inline checkbox-small"><label><input class="i-check" type="checkbox" name="facilities[]" value="children_activities" />Children Activites</label></div>
                                <div class="checkbox-inline checkbox-small"><label><input class="i-check" type="checkbox" name="facilities[]" value="casino" />Casino & Gambling</label></div>
                                <div class="checkbox-inline checkbox-small"><label><input class="i-check" type="checkbox" name="facilities[]" value="bar" />Bar/Lounge</label></div>
                        </div>
                        <div class="form-group">
                            <label>Featured hotel</label>
                            <div class="checkbox-inline checkbox-small"><label><input class="i-check" type="checkbox" name="featured" />Home page hotel visibility</label></div>
                        </div>
                        <div class="gap gap-small"></div>
                        <h4>Photos</h4>
                        <div class="form-group form-upload">
                            <div class="fileUpload btn btn-primary">
                                <span>Upload</span><input name="hotelPhotos[]" id="hotelPhotos" type="file" multiple="" class="form-control upload" />
                            </div>
                        </div>
                        <div class="gap gap-small"></div>
                        <h4>Location</h4>
                        <div class="row">
                            <div class="col-md-6">
                                <div class="form-group">
                                    <label>Street Address *</label>
                                    <input name="hotel_address" type="text" value="" class="form-control required">
                                </div>
                                <div class="form-group">
                                    <label>City *</label>
                                    <input name="hotel_city" type="text" value="" class="form-control required">
                                </div>
                                <div class="form-group">
                                    <label>Coordinates</label>
                                    <input name="hotel_coords" type="text" value="" placeholder="lat, lon" class="form-control">
                                </div>
                            </div>
                            <div class="col-md-6">
                                <div class="form-group">
                                    <label>ZIP code/Postal code *</label>
                                    <input name="hotel_zip" type="text" value="" class="form-control required">
                                </div>
                                <div class="form-group">
                                    <label>Country *</label>
                                    <input name="hotel_country" type="text" value="" class="form-control required">
                                </div>
                            </div>
                        </div>
                        <div class="gap gap-small"></div>
                        <h4>Room Types</h4>
                        <table class="table table-bordered table-striped table-booking-history">
                            <colgroup>
                                <col width="15%">
                                <col width="10%">
                                <col width="10%">
                                <col width="10%">
                                <col width="45%">
                                <col width="10%">
                            </colgroup>
                            <thead>
                                <tr>
                                    <th>Type</th>
                                    <th>Rooms</th>
                                    <th>Guests</th>
                                    <th>Price</th>
                                    <th>Details</th>
                                    <th>Photo</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td><input name="room_type1_name" type="text" value="Single" class="form-control required2"></td>
                                    <td><input name="room_type1_number" type="text" value="0" class="form-control required2 room_type_number"></td>
                                    <td><input name="room_type1_guests" type="text" value="" class="form-control required2"></td>
                                    <td><input name="room_type1_price" type="text" value="" class="form-control required2"></td>
                                    <td><textarea name="room_type1_details" class="form-control"></textarea></td>
                                    <td>
                                        <div class="fileUpload btn btn-primary">
                                            <span>Upload</span><input name="room_type1_photo" type="file" class="upload" />
                                        </div>
                                    </td>
                                </tr>
                                <tr>
                                    <td><input name="room_type2_name" type="text" value="Double" class="form-control required2"></td>
                                    <td><input name="room_type2_number" type="text" value="0" class="form-control required2 room_type_number"></td>
                                    <td><input name="room_type2_guests" type="text" value="" class="form-control required2"></td>
                                    <td><input name="room_type2_price" type="text" value="" class="form-control required2"></td>
                                    <td><textarea name="room_type2_details" class="form-control"></textarea></td>
                                    <td>
                                        <div class="fileUpload btn btn-primary">
                                            <span>Upload</span><input name="room_type2_photo" type="file" class="upload" />
                                        </div>
                                    </td>
                                </tr>
                                <tr>
                                    <td><input name="room_type3_name" type="text" value="Triple" class="form-control required2"></td>
                                    <td><input name="room_type3_number" type="text" value="0" class="form-control required2 room_type_number"></td>
                                    <td><input name="room_type3_guests" type="text" value="" class="form-control required2"></td>
                                    <td><input name="room_type3_price" type="text" value="" class="form-control required2"></td>
                                    <td><textarea name="room_type3_details" class="form-control"></textarea></td>
                                    <td>
                                        <div class="fileUpload btn btn-primary">
                                            <span>Upload</span><input name="room_type3_photo" type="file" class="upload" />
                                        </div>
                                    </td>
                                </tr>
                                <tr>
                                    <td><input name="room_type4_name" type="text" value="Quad" class="form-control required2"></td>
                                    <td><input name="room_type4_number" type="text" value="0" class="form-control required2 room_type_number"></td>
                                    <td><input name="room_type4_guests" type="text" value="" class="form-control required2"></td>
                                    <td><input name="room_type4_price" type="text" value="" class="form-control required2"></td>
                                    <td><textarea name="room_type4_details" class="form-control"></textarea></td>
                                    <td>
                                        <div class="fileUpload btn btn-primary">
                                            <span>Upload</span><input name="room_type4_photo" type="file" class="upload" />
                                        </div>
                                    </td>
                                </tr>
                                <tr>
                                    <td><input name="room_type5_name" type="text" value="Suite" class="form-control required2"></td>
                                    <td><input name="room_type5_number" type="text" value="0" class="form-control required2 room_type_number"></td>
                                    <td><input name="room_type5_guests" type="text" value="" class="form-control required2"></td>
                                    <td><input name="room_type5_price" type="text" value="" class="form-control required2"></td>
                                    <td><textarea name="room_type5_details" class="form-control"></textarea></td>
                                    <td>
                                        <div class="fileUpload btn btn-primary">
                                            <span>Upload</span><input name="room_type5_photo" type="file" class="upload" />
                                        </div>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                        <hr>
                        <input type="hidden" value="addHotel" name="action" />
                        <input type="submit" value="Add Hotel" class="btn btn-primary">
                    </form>
                </div>
            </div>
        </div>

        <div class="gap"></div>
        
        <script src="../assets/js/jquery.js"></script>
        <script src="../assets/js/bootstrap.js"></script>
        <script src="../assets/js/slimmenu.js"></script>
        <script src="../assets/js/bootstrap-datepicker.js"></script>
        <script src="../assets/js/bootstrap-timepicker.js"></script>
        <script src="../assets/js/nicescroll.js"></script>
        <script src="../assets/js/dropit.js"></script>
        <script src="../assets/js/ionrangeslider.js"></script>
        <script src="../assets/js/icheck.js"></script>
        <script src="../assets/js/fotorama.js"></script>
        <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&sensor=false"></script>
        <script src="../assets/js/typeahead.js"></script>
        <script src="../assets/js/card-payment.js"></script>
        <script src="../assets/js/magnific.js"></script>
        <script src="../assets/js/owl-carousel.js"></script>
        <script src="../assets/js/fitvids.js"></script>
        <script src="../assets/js/tweet.js"></script>
        <script src="../assets/js/countdown.js"></script>
        <script src="../assets/js/gridrotator.js"></script>
        <script src="../assets/js/custom.js"></script>
        <script type="text/x-javascript">
            $(document).ready(function(){
                
                $('.addHotel_form').submit(function() {
                    $('.addHotel_form input').removeClass('validation_error');
                    var validate = true;
                    $('.addHotel_form input.required').each(function() {
                        if($(this).val() == ''){
                            $(this).addClass('validation_error');
                            validate = false;
                        }
                    });
                    $('.addHotel_form input.required2').each(function() {
                        if($(this).val() == '' && parseInt($(this).parent().parent().find('.room_type_number').val()) > 0){
                            $(this).addClass('validation_error');
                            validate = false;
                        }
                    });
                    if(!validate)
                        return false;
                });
                
            })
        </script>
    </div>
</body>

</html>